<template>
	<view class="content">
		<textarea class="text_area" v-model="inputText" placeholder="请输入您的宝贵意见." />
		<button class="submit_button" type="warn" @click="submitClick()">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				inputText: ""
			};
		},
		methods: {
			submitClick() {
				uni.showLoading({
					title:"数据加载中"
				});
				this.$api.requestAddUserFeedBack({"content": this.inputText}).then((res)=>{
					console.log(res);
					uni.hideLoading();
					uni.showToast({
						title:"意见反馈成功",
						icon:"none"
					});
					setTimeout(function(){
						uni.navigateBack();
					}, 1000);
				}).catch((error)=>{
					uni.hideLoading();
					uni.showToast({
						title:"数据繁忙，请稍后再试",
						icon:"none"
					});
				});
			}
		}
	}
</script>

<style lang="scss">
	.text_area {
		margin-top: 30rpx;
		margin-left: 50rpx;
		width: 650rpx;
		border: solid 1rpx #FFFFFF;
		border-radius: 10rpx;
		color: #FFFFFF;
		height: 300rpx;
	}
	
	.submit_button {
		position: absolute;
		width: 650rpx;
		margin-left: 50rpx;
		bottom: 50rpx;
	}
	
</style>
